#include<iostream>

using namespace std;

typedef long long LL;

char p,t;
int a,b,fz,fm,c;

int gcd(int a,int b)
{
	if(b!=0) return gcd(b,a%b);
	return a;
}

int main()
{
	cin>>fz>>p>>fm;
	while(cin>>p)
	{
		cin>>a>>t>>b;
		if(p=='+') fz=fz*b+a*fm;
		else fz=fz*b-a*fm;
		fm*=b;
		c=gcd(fz,fm);
		fz/=c,fm/=c;
	}
	if(fm==1) cout<<fz<<endl;
	else if(fm<0) cout<<-fz<<"/"<<-fm<<endl;
	else cout<<fz<<"/"<<fm<<endl;
	return 0;
 } 
